package com.aizhixin.test.my.controller;

import java.util.List;

import javax.security.auth.message.callback.PrivateKeyCallback.Request;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.aizhixin.test.my.dto.GeRenPaiMinDTO;
import com.aizhixin.test.my.dto.RankingTableDTO;
import com.aizhixin.test.my.service.paiHangBangService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;

@RestController
@RequestMapping(value = "/v1/open/paihangbang")
@Api(tags = "排行榜API")
@Slf4j
public class RankingTableBaoController {
	@Autowired
	private paiHangBangService textService;
	
	 /*
	  * 查
	  */
	 	@GetMapping(value = "/rankinglimit", produces = MediaType.APPLICATION_JSON_VALUE)
	    @ApiOperation(httpMethod ="GET", value = "查前50十名里面第x页的用户信息",
	    notes = "查前50十名里面第x页的用户信息从一开始<br><br><b>@author xixi</b>")
	    public List<RankingTableDTO> get
	    (
	    
	    @ApiParam(value="页数")
		@RequestParam(required=true,value="userId") Long page){
		 log.info("获取试题内容ID：{}",page);
		 List<RankingTableDTO> o =textService.selectPaiHangBang(page);
		 if (o==null||o.size()==0) {
	            return null;
	        }
	        return o;
	        }
	 	
	 	}
